package com.itheima.pinda.authority.biz.service.common.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.pinda.authority.biz.dao.common.OptLogMapper;
import com.itheima.pinda.authority.biz.service.common.OptLogService;
import com.itheima.pinda.authority.entity.common.OptLog;
import com.itheima.pinda.dozer.DozerUtils;
import com.itheima.pinda.log.entity.OptLogDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Description: 操作日志业务逻辑实现
 * @Author: ysf
 * @CreateTime: 2024-11-13  17:38
 * @Version: 1.0
 */

@Service
@Slf4j
@RequiredArgsConstructor
public class OptLogServiceImpl extends ServiceImpl<OptLogMapper, OptLog> implements OptLogService {

    final DozerUtils dozerUtils;

    /**
    * 保存操作日志
    * @param optLogDTO
    * @return boolean
    */
    @Override
    public boolean save(OptLogDTO optLogDTO) {
        return super.save(dozerUtils.map(optLogDTO,OptLog.class));
    }
}
